package org.java8newfeature;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class StreamDemo {

    public static void main(String[] args) {
        String[] str = {"qiaodan", "liudehua", "zhangfei", "caoyide"};
        List<String> lists = Arrays.asList(str);

        List<String> l = lists.stream()
                .filter(var -> {
                    if ("liudehua".equals(var))
                        return true;
                    return false;
                })
                .map(String::toUpperCase)
                .sorted()
                .collect(Collectors.toList());
        for (String s : l) {
            System.out.println(s);
        }
    }
}
